package com.changgou.goods.dao;

import com.changgou.goods.pojo.Spec;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface SpecMapper extends Mapper<Spec> {

    @Select("SELECT\n" +
            "\ts.name, s.options\n" +
            "FROM\n" +
            "\ttb_spec s\n" +
            "JOIN\n" +
            "\ttb_category c\n" +
            "ON\n" +
            "\ts.template_id = c.template_id\n" +
            "WHERE\n" +
            "\tc.name=#{categoryName}")
    List<Map> findSpecListByCategoryName(@Param("categoryName") String categoryName);

}
